//---------------------------------------------------------------------------

#ifndef t_concurrencyformH
#define t_concurrencyformH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.Dialogs.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.ImgList.hpp>
//---------------------------------------------------------------------------
class HScrollingWinControl;
class TConcurrencyForm : public TForm
{
__published:	// IDE-managed Components
   TPanel *Panel1;
   TLabel *Label2;
   TLabel *Label4;
   TEdit *EditEndTime;
   TButton *ButtonDrawChart;
   TButton *ButtonSaveChart;
   TComboBox *ComboBoxPeriod;
   TButton *ButtonWindow;
   TButton *ButtonPanel;
   TImageList *ImageList1;
   TSaveDialog *SaveDialog1;
   void __fastcall ButtonDrawChartClick(TObject *Sender);
   void __fastcall ButtonSaveChartClick(TObject *Sender);
   void __fastcall ButtonWindowClick(TObject *Sender);
   void __fastcall ButtonPanelClick(TObject *Sender);
   void __fastcall FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
private:	// User declarations
   struct HLastInfo
   {
      TDateTime DateTime;
      int x;
      int y;
      int Height;
      double Last;
      double Min;
      double Max;
      double Total;
      int Qty;
   };
   struct HParaTimeInfo
   {
      TDateTime Time;
      int Para;
   };
   void __fastcall TextOutVert(int x, int y, const UTF8String &Str);
   void __fastcall PrepareData();
   void __fastcall DrawBackground();
   void __fastcall DrawGrid();
   void __fastcall DrawLines();
   void __fastcall DrawSplitter();
   HScrollingWinControl *ScrollingWinControl1;
   TImage *Image1;
   int WindowHeightIdx;
   bool ShowPanelFlag;
   vector<HPartTimeInfo> PartVec;
   vector<TDateTime> SplitterVec;
   vector<HParaTimeInfo> ParaTimeVec;
   UTF8String BatchStartTimeStr;
   UTF8String BatchEndTimeStr;
   TDateTime StartTime;
   TDateTime EndTime;
   int TotalSec;
   double MaxValue;
   static const int LEFT = 0;
   static const int TOP = -300;
public:		// User declarations
   __fastcall TConcurrencyForm(TComponent* Owner);
   void __fastcall Init();
   void __fastcall ShowIt();
   void __fastcall DrawLines_aux(int &StartX, int &EndX, int &LengthX,
      int &StartY, int &EndY, int &LengthY);
};
//---------------------------------------------------------------------------
extern PACKAGE TConcurrencyForm *ConcurrencyForm;
//---------------------------------------------------------------------------
#endif
